package com.cloudkinto.service.product;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.bo.order.inbound.NormalReceiptConfirmBo;
import com.cloudkinto.bo.order.inbound.NormalReceiptConfirmNewProductBo;
import com.cloudkinto.bo.print.PrintSkuBo;
import com.cloudkinto.bo.product.*;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.ProductDo;
import com.cloudkinto.service.product.vo.ProductMsgVo;
import com.cloudkinto.vo.common.CommonBatchOperationVo;
import com.cloudkinto.vo.product.ProductVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 产品表 service接口
 * </p>
 *
 * @author long
 * @since 2024-10-29
 */
public interface ProductService extends IService<ProductDo> {

    SingleResult<Map<String, Object>> addInit();

    void add(ProductAddBo bo, Long userId, String username, Long companyId, Long tenantId);


    void update(ProductUpdateBo bo, Long userId, String username, Long tenantId);

    int delete(Long id, Long userId, Long tenantId);

    ProductVo detail(Long id);

    SingleResult pageInit(Long userId, Long tenantId, String source);

    PageResult getListPage(ProductQueryBo bo);

    PageResult getListPageApi(ProductQueryBo bo);

    boolean skuAvailable(String sku, Long companyId, Long tenantId);

    SingleResult statusStatistics(ProductQueryBo bo);

    void approve(ProductApproveBo bo, Long userId, String username);

    CommonBatchOperationVo importUpdateProductOmp(MultipartFile file, Long companyId, Long userId, String username, Long tenantId);

    List<ProductDo> normalReceiptConfirmNewProductKeepList(NormalReceiptConfirmBo bo, Long tenantId);

    PageResult getNewProductKeepPageList(NewProductQueryBo bo, Long tenantId);

    void normalReceiptConfirmNewProductKeep(
            List<NormalReceiptConfirmNewProductBo> bo,
            Long userId,
            String username,
            Long tenantId
    );

    CommonBatchOperationVo importProduct(MultipartFile file, Long userId, String username, Long tenantId, Long companyId);

    void export(ProductQueryBo bo, HttpServletResponse response) throws IOException;

    void printBarCodePdf(PrintSkuBo bo, HttpServletResponse response);

    CommonBatchOperationVo discardProduct(DiscardProductBo bo, Long userId, String username);

    CommonBatchOperationVo recoverProduct(RecoverProductBo bo, Long userId, String username);

    CommonBatchOperationVo pushProductToWms(PushProductToWmsBo bo, Long userId, String username);

    CommonBatchOperationVo deleteProduct(DeleteProductBo bo, Long userId, String username);

    void getOmsImportUpdateProductTemplate(HttpServletResponse response, Long tenantId) throws IOException;

    void getOmpImportUpdateProductTemplate(HttpServletResponse response, Long tenantId, Long userId) throws IOException;

    CommonBatchOperationVo omsImportUpdateProduct(MultipartFile file, Long tenantId, Long companyId, Long userId, String username);

    /**
     * 获取产品重量
     */
    List<ProductMsgVo> getProductWeight(List<Long> productIds, Long companyId);

    void getImportProductTemplate(HttpServletResponse response, Long tenantId) throws IOException;
}
